'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')

module.exports = {
  // Various Dev Server settings
  env: merge(prodEnv, {
    NODE_ENV: '"development"',
    REMOVE_PROD_TIP: false,
    RUN_MODE: "'" + process.env.npm_lifecycle_event + "'",
  }),
  // Paths
  assetsSubDirectory: 'static',
  assetsPublicPath: '/',
  proxyTable: {
    '/api': {
      target: 'http://192.168.0.35:8088/', //test
      secure: false, // 是否https接口
      changeOrigin: true, // 是否跨域
      pathRewrite: {
        '^/api': '', // rewrite转写，否则target部分也会包含前缀
      },
    },
  },
  host: 'localhost', // can be overwritten by process.env.HOST
  port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  autoOpenBrowser: false,
  errorOverlay: true,
  notifyOnErrors: true,
  poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  // noticeURL: "http://127.0.0.1:8089", //消息通知服务本地调试
  // socketURL: "ws://127.0.0.1:8089/common/msgStream", //建立websocket连接的ws协议
  /**
   * Source Maps
   */
  // https://webpack.js.org/configuration/devtool/#development
  // devtool: 'cheap-module-eval-source-map',
  devtool: 'module-source-map',

  // If you have problems debugging vue-files in devtools,
  // set this to false - it *may* help
  // https://vue-loader.vuejs.org/en/options.html#cachebusting
  cacheBusting: true,
  cssSourceMap: false,
}
